package com.taxicall.udptransport;

import java.io.IOException;
import java.net.InetAddress;

import com.taxicall.entities.NetworkMessage;

public interface UdpSender {
	
//	UdpSender() throws SocketException {
//		socket = new DatagramSocket();
//	}
//	
//	public void send(NetworkMessage msg, String address, int port) throws IOException {
//		InetAddress inetAddress;
//		try {
//			inetAddress = InetAddress.getByName(address);
//		} catch (UnknownHostException e) {
//			this.close();
//			throw new RuntimeException(e);
//		}
//		
//		byte[] data = SerializationUtils.serialize(msg);
//
//		DatagramPacket packet = new DatagramPacket(data, data.length, inetAddress, port);
//		socket.send(packet);
//	}
	
	public void send(NetworkMessage msg, InetAddress fromAddress, int port) throws IOException;	
}
